-
Notifications
You must be signed in to change notification settings - Fork 2
Define "_Row" and "_Column" in the registry #144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the component registry system to support globally defined _Row and _Column components, while also improving display template resolution at the section level. The changes enable more flexible component rendering configurations through the registry.
Key changes:
- Made
nodesprop mandatory inOptimizelyGridSectionto prevent runtime errors - Added support for
_Rowand_Columnregistry lookups with fallback chain - Extended display template key resolution to check section-level composition keys
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/optimizely-cms-sdk/src/react/server.tsx | Enhanced grid section rendering to check registry for _Row/_Column components, made nodes required, and improved display template key resolution |
| test/test-website/src/components/with-display-templates.tsx | Added test display templates and component variants for rows/columns, removed console.log statements, and exported components for registry |
| test/test-website/src/app/preview/page.tsx | Added conditional check before logging error request query |
| test/test-website/src/app/preview/layout.tsx | Simplified by reusing root layout |
| test/test-website/src/app/en/layout.tsx | Registered new display templates and _Row/_Column components in the registry |
| test/test-website/src/app/all/[...slug]/layout.tsx | Simplified by reusing root layout |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
__test__/test-website/src/components/with-display-templates.tsx
Outdated
Show resolved
Hide resolved
__test__/test-website/src/components/with-display-templates.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This PR
<OptimizelyGridSection>renders by searching in the component registry if there is any component defined as_Rowor_Column<OptimizelyGridSection>renders properly by making the propnodesmandatory<OptimizelyComponent>searches Display Template Keys when they are defined in the Section level